home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 1
/
SPACE - Library 1 - Volume 1.iso
/
games
/
365
/
devastor
/
deva_gfa.lst
next >
Wrap
File List
|
1987-11-29
|
6KB
|
280 lines
For Colreg=0 To 15
Setcolor Colreg,1911
Next Colreg
Dim Shape$(3),X(18),Y(18)
@Init
Restore
For Colreg=0 To 15
Read Pal
Setcolor Colreg,Pal
Next Colreg
Data 0,1792,112,7,7,119,2017,1365,819,1843,883,1907,823,1847,887,1911
For I=1 To 3
For P=1 To 12
Sound 1,15,P,5,1
Next P
For P=11 To 2 Step -1
Sound 1,15,P,5,1
Next P
Next I
Sound 1,1,0,0,0
L$=" | "+Chr$(14)+Chr$(15)+"ST DEVASTATOR|an easy arcade game| in GFA BASIC"
Alert 1,L$,1,"INTRO|START",Key
Hidem
On Key Gosub Text
Restartgame:
X=40
Y=100
Xp=80
Yp=100
Time.limit=9
T=Timer
Charges=1
Score=0
Put X,Y,Cross$,6
Showtime:
Time=Trunc(Timer-T)/200+Frac(Timer-T)
Print At(15,21);"Countdown:";Time.limit-Int(Time)
Nualien:
Ax=80+130*Rnd
Ay=30+60*Rnd
Put Ax,Ay,Alien$,6
I=3
Mainloop:
Vsync
Put Xp,Yp,Shape$(I)
Put X,Y,Cross$,6
Mx=Mousex
My=Mousey
X=X+(-5*(X<Mx)+5*(X>Mx))
Y=Y+(-5*(Y<My)+5*(Y>My))
Put X,Y,Cross$,6
Put Ax,Ay,Alien$,6
Z=Rnd
Ax=Ax+4*(Z<0.3)*(Ax<180)-4*(Z>0.6)*(Ax>Xp)
Z=Rnd
Ay=Ay+4*(Z<0.3)*(Ay<80)-4*(Z>0.6)*(Ay>35)
Put Ax,Ay,Alien$,6
If Time.limit-Int(Time)<0 Then
Goto Setcharge
Endif
I=I-1
If I=0 Then
I=3
Endif
If Mousek<1 Then
Time=Trunc(Timer-T)/200+Frac(Timer-T)
Print At(15,21);"Countdown:";Time.limit-Int(Time)
If (Time.limit-Int(Time))<0 Then
Print At(15,21);"Countdown: "
Endif
Goto Mainloop
Endif
Sound 1,15,11,7,20
If Abs(Ax-X+9)>7 Or Abs(Ay-Y+4)>6 Then
Sound 1,1,0,0,0
Goto Mainloop
Endif
Sav.time=Time.limit-Int(Time)
Wave 9,1,7,31,25
Sound 1,15,4,4,2
For I=1 To 15
Put Ax,Ay,Alien$,6
Sound 1,15,13-I,0,2
Setcolor 0,1792
Pause 1
Setcolor 0,0
Next I
Wave 9,0,0,0,0
Sound 1,0,0,0,0
Aliens=Aliens+1
Score=Score+10*(Sav.time)
If (Aliens Mod 5)=0 Then
If Time.limit>1 Then
Time.limit=Time.limit-1
Endif
Endif
Print At(16,23);"Score:";Score
T=Timer
Goto Showtime
Setcharge:
For I=1 To 3
For P=1 To 12
Sound 1,15,P,5,1
Next P
For P=11 To 2 Step -1
Sound 1,15,P,5,1
Next P
Next I
Sound 1,1,0,0,0
Print At(14,22);"Charges Set:";Charges
Put Ax,Ay,Alien$,6
For I=1 To 10
Put 90,31,Earth$,6
Pause 2
Next I
Rads1=(Pi*Charges/8)*1000
Charges=Charges+1
Rads=(Pi*Charges/8)*1000
Defline 1,2,2,0
Color 2
Circle 100,41,13,Rads1,Rads
If Charges<11 Then
T=Timer
Goto Showtime
Endif
For I=1 To 15 Step 0.3
Put 90-(I*Rnd)/2,31-(I*Rnd)/2+I*Rnd,Earth$,6
Next I
Deffill 0,1,1
For I=1 To 46 Step 2
Pcircle 95,43,I/2
Next I
Color 1
Box 78,29,241,151
If Score>Hiscore Then
Hiscore=Score
N$="| Good Work!!"
Else
N$="|Better Luck Next Time"
Endif
Score$=Str$(Score)
Hiscore$=Str$(Hiscore)
M$=" | Your Score:"+Score$+"| High Score:"+Hiscore$+N$
Alert 3,M$,1," EXIT |RESTART",Var
If Var=2 Then
Cls
Deftext 1,16,0,12
Text 70,18,"DEVASTATOR"
Color 1
Box 78,29,241,151
For S=1 To 120
Color Rnd*6+1
Plot 78+Rnd*155,30+Rnd*80
Next S
Deffill 0,1,1
Pcircle 100,42,10
Put 90,31,Earth$,6
Print At(16,23);"Score:0"
Print At(14,22);"Charges Set:0"
Goto Restartgame
Endif
Leavegame:
Setcolor 0,1911
Setcolor 15,0
End
Procedure Init
For Base=1 To 3
Cls
X=60
Y=0
Z=10
C=Base
R=3
M=2
For I=1 To 8
Color C+1
Draw 0,Y To X,Y To X,Y+Z To 160-X,Y+Z To 160-X,Y To 160,Y To 160,Y+R To 160-X+R,Y+R To 160-X+R,Y+Z+R+M To X-R,Y+Z+R+M To X-R,Y+R To 0,Y+R To 0,Y
X=X-R-1
Y=Y+R+1
Z=Z+M
R=R+0.7
C=C+1
If C>3 Then
C=1
Endif
Next I
Y=0
R=3
C=Base
For I=1 To 8
Deffill C+1,1,1
Fill 1,Y+2
Y=Y+R+1
C=C+1
If C>3 Then
C=1
Endif
R=R+0.75
Next I
Color 0
Line 60,0,X,Y
Line 100,0,160-X,Y
Line 60,10,X,Y+Z
Line 100,10,160-X,Y+Z
Get 0,0,159,49,Shape$(Base)
Next Base
Cls
Deffill 4,1,1
Pcircle 10,10,10
Restore Earth
For I=0 To 18
Read X(I),Y(I)
Next I
Deffill 10,1,1
Polyfill 18,X(),Y()
Earth:
Data 6,3,11,3,11,5,14,5,14,4,14,7,16,9,17,10,16,8,11,9,11,12,14,12,8,19,4,13,9,11,7,10,6,6,3,5,6,3
Get 0,0,19,19,Earth$
Cls
Color 3
Line 3,0,3,6
Line 0,3,6,3
Get 0,0,6,6,Cross$
Cls
Deffill 4,1,1
Color 2
Ellipse 30,10,10,5,3200,2200
Line 20,10,40,10
Fill 28,8
Color 3
Ellipse 30,10,12,5,3200,2200
Get 10,0,52,25,Alien$
Cls
Deftext 1,16,0,12
Text 70,18,"DEVASTATOR"
Color 1
Box 78,29,241,151
For S=1 To 120
Color Rnd*6+1
Plot 78+Rnd*150,30+Rnd*80
Next S
Deffill 0,1,1
Pcircle 100,42,10
Put 90,31,Earth$,6
Put 80,100,Shape$(3)
Print At(16,23);"Score:0"
Print At(14,22);"Charges Set:0"
Return
Procedure Text
Sget Screen1$
Deftext 1,1,0,24
Cls
Text 18,22,"D E V A S T A T O R"
Deftext 1,0,0,6
Text 26,38,"The Devastator, an alien ship of"
Text 12,47,"incredible power, is now approaching"
Text 12,55,"the Earth. Its mission is to utterly"
Text 20,63,"destroy the planet, and absorb the"
Text 28,71,"energy released by the explosion"
Text 28,80,"Earth's primitive technology can"
Text 28,89,"assemble only one spaceship that"
Text 10,98,"can hope to discourage the Devestator"
Text 30,107,"You, as the pilot of that craft"
Text 36,116,"are truely Earth's last hope."
Text 10,125,"The Devestator sends out small ships"
Text 8,134,"to plant the charges that will effect"
Text 8,143,"Earth's demise. They will attempt to"
Text 28,152,"evade you, but cannot shoot back."
Text 18,161,"You have only a few seconds to shoot"
Text 18,170,"each ship before it plants a charge."
Text 22,179,"Once ten charges have been planted,"
Deftext 2,1,0,6
Text 100,188,"it's too late!"
Deftext 1,1,0,4
Text 46,198,"Click either Mouse button to continue"
Repeat
Until Mousek
Sput Screen1$
Return